import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';

export const querySchema: FormSchemaGetter = () => [
  {
    component: 'Input',
    fieldName: 'resourceName',
    label: '按钮名称',
  },
];

export const columns: VxeGridProps['columns'] = [
  {
    title: '按钮名称',
    field: 'resourceName',
  },
  {
    title: '按钮Code',
    field: 'resourceCode',
  },
  {
    field: 'action',
    fixed: 'right',
    slots: { default: 'action' },
    title: '操作',
    resizable: false,
    width: 'auto',
  },
];

export const modalSchema: FormSchemaGetter = () => [
  {
    component: 'Input',
    dependencies: {
      show: () => false,
      triggerFields: [''],
    },
    fieldName: 'id',
    label: '主键',
  },
  {
    component: 'Input',
    fieldName: 'resourceName',
    label: '按钮名称',
    rules: 'required',
  },
  {
    component: 'Input',
    fieldName: 'resourceCode',
    label: '按钮Code',
    rules: 'required',
  },
];
